﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;

namespace MetaTracker.Converters
{
    public class RadioBoolToIntConverter : IValueConverter
    {
        //http://stackoverflow.com/questions/1317891/simple-wpf-radiobutton-binding
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ServiceEnum integer = (ServiceEnum)value;
            if (integer == (ServiceEnum)int.Parse(parameter.ToString()))
                return true;
            else
                return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return parameter;
        }
    }
    
    
    
}
